package com.suisung.shopsuite.sys.job;

import cn.hutool.extra.spring.SpringUtil;
import com.suisung.shopsuite.trade.service.OrderService;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

@Component
public class OrderStatusJob {
    //@Scheduled(cron = "0/1 * * * * ?")
    //@PostConstruct
    public  void a(){
        OrderService orderService = SpringUtil.getBean(OrderService.class);
        System.out.println("---------定时任务执行----------------");
        // 自动取消未支付订单
        orderService.autoCancelOrder();

        // 自动确认收货
        orderService.autoReceive();
    }
}
